From 2b5302587645dcab7c012c550989b7a8e9bee72b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Oct 2024 23:04:27 +0000 Subject: Update blog post metadata and styles --- src/pages/[...page].astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pages/[...page].astro') diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro index cd64d66..6d513b2 100644 --- a/src/pages/[...page].astro +++ b/src/pages/[...page].astro @@ -8,7 +8,10 @@ import PostSummary from "../components/PostSummary.astro"; type Props = InferGetStaticPropsType; export const getStaticPaths = (async ({ paginate }) => { - const posts = await getCollection("blog"); + const posts = await getCollection("blog", ({ data }) => { + return data.draft !== true; + }); + posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); return paginate(posts, { -- cgit v1.2.3